package com.ruike.alisurface;

import android.os.Build;
import android.os.Environment;

import com.voodoo.lib_logcat.L;

import java.io.File;

/**
 * Author：voodoo
 * CreateTime：2021/06/07 007 下午 02:01
 * Description：APP中的常量
 */
public class Constant {
    public static boolean isShopShipment = false;//是否是出货中

    public static boolean isTemperature_control = false;//是否是温控
    public static final String APP_TYPE = "SY20231227"; // SY20231227 内蒙古心研科技-医保对接(售药机高级版)
    public static final String SHAPP_TYPE = Build.VERSION.SDK_INT > Build.VERSION_CODES.KITKAT ? "SH_3288A" : "SH"; // App类型，由后台创建并给定该值


    public static class FilePath {
//        SDCard 文件目录
//          ├ ALogs
//          │        ├ com.ruike.alisurface  主程序日志文件夹
//          │        └ com.voodoo.appdaemon  守护程序日志文件夹
//          ├ com.ruike.system.folder
//          │        └ mainPackageShare.txt  主程序和守护程序的共享文件
//          └ RkApplicationFolder
//                   ├ App                   下载的APK文件价
//                   ├ Picture               图片文件夹
//                   │   └ Product           商品图片文件夹
//                   └ Adv                   广告文件夹
//                      ├ Image              图片广告文件夹
//                      └ Video              视频广告文件夹

        // SD卡根目录地址
        private static String BASE_SDCARD_PATH = Environment.getExternalStorageDirectory().getPath();
        // 文件分隔符
        private static String SEPARATOR = File.separator;

        // Log日志保存的地址
        public static final String LOGCAT_SAVE_FILE_PATH = BASE_SDCARD_PATH + SEPARATOR + "ALogs" + SEPARATOR + BuildConfig.APPLICATION_ID + SEPARATOR;

        // 主程序包名的存储文件路径
        public static final String MAIN_PACKAGE_NAME_FILE_PATH = BASE_SDCARD_PATH + SEPARATOR + "com.ruike.system.folder" + SEPARATOR;
        public static final String mainPackageShare1 = "mainPackageShare.txt";

        // 睿科的文件目录
        private static String RK_FOLDER_PATH = BASE_SDCARD_PATH + SEPARATOR + "RkFolder" + SEPARATOR;
        // 下载的APK的路径
        public static String APK_FOLDER_PATH = RK_FOLDER_PATH + "App" + SEPARATOR;
        // 下载的商品图片路径
        private static String PICTURE_PATH = RK_FOLDER_PATH + "Picture" + SEPARATOR;
        // 下载的广告图或视频路径
        private static String ADV_PATH = RK_FOLDER_PATH + "Adv" + SEPARATOR;

        // 商品图片保存地址
        public static String PRODUCT_IMAGE_FOLDER_PATH = PICTURE_PATH + "Product" + SEPARATOR;
        // 图片广告保存地址
        public static String ADV_IMAGE_FOLDER_PATH = ADV_PATH + "Image" + SEPARATOR;
        // 视频广告保存地址
        public static String ADV_VIDEO_FOLDER_PATH = ADV_PATH + "Video" + SEPARATOR;

        public static String QRCODE_PATH = AppApplication.getAppContext().getExternalCacheDir() + File.separator
                + "qrcode" + File.separator + "SnCode.jpeg";//二维码的路径和名称
        public static String ICON_PATH = AppApplication.getAppContext().getExternalCacheDir()+ File.separator
                + "logos" + File.separator ;// logo的路径

        public static String USBIMAGES = Environment.getExternalStorageDirectory() + "/Images/";//USB摄像头的默认路径
        public static String IDCARD_PATH = BASE_SDCARD_PATH + SEPARATOR + "/Mediction/idcard/";//身份证文件夹
        public static String PRESCRIP_PATH = BASE_SDCARD_PATH + SEPARATOR + "/Mediction/prescrip/";//处方文件夹
        public static String SCREENSHOTS_PATH = BASE_SDCARD_PATH + SEPARATOR + "/Mediction/screenshots/";//截图的文件夹
    }

    public static class HttpUrl {


        public static final String BASE_URL = "http://www.shouhuojiyun.com/Rknew/"; // 正式接口
        //        public static final String BASE_URL = "http://c.shouhuojiyun.com/"; // 测试接口
        public static final String BASE_URL_IP = "http://120.78.219.34:8018/"; // 正式CMD指令回调接口

    }

    public static class AdvType { // 0：轮播图 1：视频 2：无广告
        public static final String ADV_TYPE_KEY = "advTypeShareKey";
        public static final int NONE = 2;
        public static final int IMAVE = 0;
        public static final int VIDEO = 1;
    }

    public static class SharedKey {
        public static final String ADV_IMAGE_DELAY_TIME_MS = ""; // 轮播图轮播间隔时长Key
    }

    public static class DefultData {
        public static final int ADV_IMAGE_DELAY_TIME_MS = 3000; // 轮播图轮播间隔默认时长
    }

    public static class LogCat {
        // log总开关，包括输出到控制台和文件
        public static final boolean IS_SHOW_LOG = true;
        // 是否输出到控制台开关
        public static final boolean IS_SHOW_CONSOLE_LOG = true;
        // 打印log时是否存到文件的开关
        public static final boolean IS_SAVE_LOG_FILE = true;
        // log全局标签
        public static final String LOG_TAG = "=tjf=";
        // 设置log头信息开关
        public static final boolean LOG_HEAD_SWITCH = true;
        // Log日志保存的地址
        public static final String SAVE_FILE_PATH = FilePath.LOGCAT_SAVE_FILE_PATH;
        // 文件名前缀为空时，默认为""，即写入文件为"yyyy-MM-dd.log"
        public static final String FILE_PREFIX = "";
        // 输出日志是否带边框开关
        public static final boolean BORDER_SWITCH = true;
        // 一条日志仅输出一条
        public static final boolean SIGLE_TAG_SWITCH = true;
        // log的控制台过滤器
        public static final int CONSOLE_FILTER = L.V;
        // log文件过滤器
        public static final int FILE_FILTER = L.V;
        // log 栈深度
        public static final int STACK_DEEP = 1;
        // 栈偏移，二次封装的话就需要设置
        public static final int STACK_OFFSET = 1;
        // 日志可保留天数，-1为无限时长
        public static final int SAVE_DATYS = 15;
    }

}
